package shap03;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/8 10:18
 * @description:长方形类：长宽
 */
public class Rectangle {
  private int width;
  private int height;

  public int getWidth() {
    return width;
  }

  public void setWidth(int width) {
    this.width = width;
  }

  public int getHeight() {
    return height;
  }

  public void setHeight(int height) {
    this.height = height;
  }
    //构造方法
     Rectangle() {}
    Rectangle(int width,int height){
      this.height=height;
      this.width=width;
  }
  //特殊方法
  /**
   * 求周长
   */
  void circumference(){
    int c=(width+height)*2;
    System.out.println("周长是："+c);
  }
  /**
   * 求面积
   * @return
   */
  int area(){
    int a=width*height;
    return a;
  }
}


